#include<iostream>
using namespace::std;

string addStrings(string num1, string num2)
{
    string ret = "";
    int carry = 0;

    int i = num1.size() - 1;
    int j = num2.size() - 1;

    while (i >= 0 || j >= 0 || carry != 0)
    {
        int n1 = (i >= 0) ? num1[i] - '0' : 0;
        int n2 = (j >= 0) ? num2[j] - '0' : 0;
        
        int sum = n1 + n2 + carry;

        carry = sum / 10;
        ret += (sum % 10) + '0';

        i--;
        j--;
    }

    reverse(ret.begin(), ret.end());

    return ret;
}

int main()
{
    string s1("451589237082730912312");
    string s2("28936489213749081294710827340");

    cout << addStrings(s1, s2) << endl;

    return 0;
}
